using System;
using System.Text;
using Catastrophe.Common.FileM;

namespace Catastrophe.Common.EndeCrypt
{
	public class Base64Cal : IEncrypt
	{
		public string BaseEncode(EncodeTypeEnum codeType, string value)
		{
			byte[] bytes = Encoding.GetEncoding(GetEncodeTypeActual.GetValue(codeType)).GetBytes(value);
			return Convert.ToBase64String(bytes);
		}

		public string BaseDecode(EncodeTypeEnum codeType, string value)
		{
			byte[] bytes = Convert.FromBase64String(value);
			return Encoding.GetEncoding(GetEncodeTypeActual.GetValue(codeType)).GetString(bytes);
		}
	}
}
